package accs.gui.logic;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

public abstract class CheckerTask {
	private List<ProgressListener> listeners=new ArrayList<ProgressListener>();
	
	public void addProgressListener(ProgressListener listener) {
		listeners.add(listener);		
	}
	
	public void fireProgressUpdate(int working, int notWorking, int total) {
		for(ProgressListener l:listeners) {
			l.progressUpdate(working, notWorking, total);
		}
	}
	
	public void fireInfoTextUpdate(String text) {
		for(ProgressListener l:listeners) {
			l.infoTextUpdate(text);
		}
	}
	
	public abstract void start();
	public abstract void stop();
	public abstract boolean isRunning();
	public abstract int getTotal();
	public abstract void close() throws IOException;
	public abstract String getTitle();
}